<?php

namespace app\admin\model\pt;

use think\Model;


class LaborLog extends Model
{

    

    

    // 表名
    protected $name = 'pt_labor_log';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'log_action_text'
    ];
    

    
    public function getLogActionList()
    {
        return ['add' => __('Add'), 'del' => __('Del')];
    }


    public function getLogActionTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['log_action']) ? $data['log_action'] : '');
        $list = $this->getLogActionList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
